<!DOCTYPE html>
<html<?php if(isset($config['backgroundimage']) AND strlen($config['backgroundimage'])>0):?> style="background-size: cover; background-image: url(<?php echo $config['backgroundimage'];?>);"<?php endif;?>>
<head>
    <meta charset="utf-8">
    <title><?php echo $title.'_'.$config['webname'];?></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="资料空白,ZFAKA,发卡平台,发卡系统">
	<meta name="author" content="资料空白">
	<meta name="version" content="<?php echo VERSION;?>">
    <meta name="description" content="<?php echo $config['webdescription'];?>">
    <link rel="stylesheet" href="/res/layui/css/layui.css">
    <link rel="stylesheet" href="/templates/choice/css/style.css">
	<?php if(isset($config['shortcuticon']) AND strlen($config['shortcuticon'])>0):?>
	<link rel="shortcut icon" href="<?php echo $config['shortcuticon'];?>" /> 
	<?php else:?>
	<link rel="shortcut icon" href="/favicon.ico" /> 
	<?php endif;?>
    <script>
    var TOKEN = "<?php echo $csrf_token;?>";
    if (self != top) {
        top.location = self.location;
    }
    </script>
</head>

<body id="zlkbbody">
    <div class="fly-header <?php if(isset($config['headermenucolor']) AND strlen($config['headermenucolor'])>0):?><?php echo $config['headermenucolor'];?><?php else:?>layui-bg-black<?php endif;?>">
        <div class="layui-container">
             <div class=""><a class="fly-logo" href="/"><img src="<?php if(isset($config['logo']) AND strlen($config['logo'])>0):?><?php echo $config['logo'];?><?php else:?>/res/images/logo.png<?php endif;?>" alt="zfaka"></a></div>
            <ul class="layui-nav fly-nav" id="webmenu">
				<li></li>
                <?php if($login):?>
                <li class="layui-nav-item layui-hide-xs">
                    <a href="/member">我的账户</a>
                </li>
                <li class="layui-nav-item layui-hide-xs">
                    <a href="/product">购买商品</a>
                </li>
                <li class="layui-nav-item layui-hide-xs">
                    <a href="/member/help">帮助中心</a>
                </li>
                <?php else:?>
                <li class="layui-nav-item layui-hide-xs">
                    <a href="/product">购买商品</a>
                </li>
                <li class="layui-nav-item layui-hide-xs">
                    <a href="/product/query">查询订单</a>
                </li>
                <?php endif;?>
                <li class="layui-nav-item layui-hide-xs">
                    <a href="/about/">关于我们</a>
                </li>				
            </ul>
			
			<ul class="layui-nav fly-nav-user">
				<li class="layui-nav-item layui-hide-lg layui-hide-md layui-hide-sm layadmin-flexible">
					<a href="javascript:;" title="侧边伸缩">
					<i class="layui-icon layui-icon-spread-left" id="main-menu-mobile-switch" style="font-size: 16px;"></i>
					</a>
				</li>
			 </ul>
			 
            <ul class="layui-nav fly-nav-user layui-hide-xs">
                <?php if($login):?>
                <li class="layui-nav-item">
                    <a class="fly-nav-avatar" href="javascript:;">
                        <cite class="layui-hide-xs">
                            <?php echo $uinfo['nickname'];?>
                        </cite>
                        <i class="iconfont icon-renzheng layui-hide-xs" title="<?php echo $uinfo['nickname'];?>"></i>
                        <i class="layui-badge fly-badge-vip layui-hide-xs"><?php echo $uinfo['groupName'];?></i>
                        <img src="/res/images/avatar/<?php echo rand(0,11);?>.jpg">
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="/member/profiles/">基本设置</a></dd>
                        <dd><a href="/member/logger">我的日志</a></dd>
                        <dd><a href="/member/">我的主页</a></dd>
                        <hr style="margin: 5px 0;">
                        <dd><a href="/member/logout/" style="text-align: center;">退出</a></dd>
                    </dl>
                </li>
                <?php else:?>
					<?php if(isset($config['loginswitch']) AND $config['loginswitch']>0):?>
					<!-- 未登录的状态 -->
					<li class="layui-nav-item">
						<a class="iconfont icon-touxiang layui-hide-xs" href="/member/login/"></a>
					</li>
					<li class="layui-nav-item">
						<a href="/member/login/">登录</a>
					</li>
					<?php endif;?>
					<?php if(isset($config['registerswitch']) AND $config['registerswitch']>0):?>
					<li class="layui-nav-item">
						<a href="/member/register/">注册</a>
					</li>
					<?php endif;?>
                <?php endif;?>
            </ul>
        </div>
    </div>
	<script type="text/javascript">
	function setClassName() {
		var menuChild = document.getElementById('webmenu').childNodes,
			aName = window.location.pathname,
			aMenu = [];
		for (var i = 0, j = menuChild.length; i < j; i++) {
			if (menuChild[i].nodeType != 3) {
				aMenu.push(menuChild[i]);
			}
		}
		<?php if($login):?>
		if (aName.indexOf('/member') == 0) {
			aMenu[1].className += ' layui-this';
		} else if (aName.indexOf('/product') > -1 || aName.indexOf('/group') > -1) {
			aMenu[2].className += ' layui-this';
		} else if (aName.indexOf('/member/help') > -1) {
			aMenu[3].className += ' layui-this';
		} else if (aName.indexOf('/about') > -1) {
			aMenu[4].className += ' layui-this';
		}
		<?php else:?>
		if (aName.indexOf('/product/query') > -1) {
			aMenu[2].className += ' layui-this';
		} else if (aName.indexOf('/product') > -1 || aName.indexOf('/group') > -1) {
			aMenu[1].className += ' layui-this';
		} else if (aName.indexOf('/about') > -1) {
			aMenu[3].className += ' layui-this';
		}
		<?php endif;?>
	}
	setClassName();
	</script>
<ul class="layui-nav layui-nav-tree layui-inline" lay-filter="main-menu" id="main-menu-mobile" style="display: none;z-index: 19891016;width: 300px;">
  <li class="layui-nav-item layui-nav-itemed">
    <a href="javascript:;">主菜单</a>
    <dl class="layui-nav-child">
		<?php if($login):?>
		<dd><a href="/member/">我的账户</a></dd>
		<dd><a href="/product">购买商品</a></dd>
		<dd><a href="/member/help">帮助中心</a></dd>
		<dd><a href="/member/logout/">退出</a></dd>
		<?php else:?>
		<dd><a href="/product/">购买商品</a></dd>
		<dd><a href="/product/query">查询订单</a></dd>
		<?php if(isset($config['loginswitch']) AND $config['loginswitch']>0):?><dd><a href="/member/login/">登录</a></dd><?php endif;?>
		<?php if(isset($config['registerswitch']) AND $config['registerswitch']>0):?> <dd><a href="/member/register/">注册</a></dd><?php endif;?>
		<?php endif;?>
    </dl>
  </li>
</ul>
<div class="site-mobile-shade"></div>